package com.wf.day_0604.test1.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

/**
 * @author mpk
 * @since 2024/6/4 15:26:40
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Book  {

    /**
     * 类型
     */
    private String type;

    /**
     * 书名
     */
    private  String name;

    /**
     * 价格
     */
    private  Double price;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Book book = (Book) o;
        return Objects.equals(type, book.type) && Objects.equals(name, book.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(type, name);
    }

    public Book(String type, String name) {
        this.type = type;
        this.name = name;
    }
}
